<template>
	<view class='page'>
		<view class='fixed-top-cont'>
			<view class="cont-block">
				<block v-for="(item,index) in itemList">
					<view class="cont-list" :data-id="index" @tap="tab" :class="currentTab == index ? 'listActive' : ''">
						<view class="newstabBar" :class="currentTab==index?'listActiveWhite':'listActiveWhite'">
							 <text v-if="item.index==0">装修</text>
							<text v-if="item.index==1">同城</text>
							<text v-if="item.index==2">二手</text>
							 <text v-if="item.index==3">我要</text>
							<text>{{item.name}}</text>
						</view>

					</view>
				</block>
			</view>
		</view>
		
		
		<!-- 商店列表的开始-->
		<view class="weui-tab" v-if="currentTab == 1">
			<view class='tcmerchant'>
			</view>
			<view class='merchant-list-shop'>
				<view class="shop-list" v-for="(item,index) in list">
					<!-- :url="'../merchant?merId='+item.id+'&userId='+item.user_id+'&type='+item.type" -->
					<navigator :url="'../merchant?merId='+item.id+'&userId='+item.user_id+'&type='+item.type" hover-class="none" class='shop-list-mess'>
						<view class='shop-list-head'>
							<image :src="item.shop_avatar"></image>
						</view>
						<view class='shop-list-cont'>
							<view class='list-cont-name'>
								<text class='list-cont-name-name'>{{item.name}}</text> <text class='list-cont-name-distance'>{{item.distance}}KM</text>
							</view>
							<view>
								<block v-for="(i,item) in item.starLevel">
									<image class="icon-star" v-if="i" src="../../../static/images/user-center/star-light.png"></image>
									<image class="icon-star" wx:else src="../../../static/images/user-center/star-dark.png"></image>
								</block>
							</view>
							<view class='list-cont-label'>
								<text v-if="item.main_category">{{item.main_category}}</text>
								<text v-if="item.sub_category">{{item.sub_category}}</text>
							</view>
							<view class='list-cont-location'>
								<!-- <image src='../../../static/images/list/host.png'></image> -->
								<image class="address-card-host" mode="scaleToFill" src="https://gy-files.oss-cn-shenzhen.aliyuncs.com/small_img/weizhi.png"></image>
								<text>{{item.address}}</text>
							</view>
						</view>
					</navigator>
					<view class='shop-btn'>
						<view class='shop-btn-list' :data-name="item.name" :data-address="item.address" :data-latitude="item.latitude"
						 :data-longitude="item.longitude" @tap='goMap'>
							<image src='../../../static/images/list/host.png'></image>
							<text>导航到家</text>
						</view>
						<view class='shop-btn-list' :data-tel="item.mobile" @tap='phonecallevent'>
							<image src='../../../static/images/tel-red.png'></image>
							<text>联系商家</text>
						</view>
						<!-- ../merchant?merId=item.id&userId=item.user_id&type=item.type -->
						<navigator :url="'../merchant?merId='+item.id+'&userId='+item.user_id+'&type='+item.type" hover-class="none"
						 class='shop-btn-list'>
							<image src='../../../static/images/right.png'></image>
							<text>进店逛逛</text>
						</navigator>
					</view>
				</view>
			</view>
		</view>



		<!-- 二手闲置 -->
		<view class="weui-tab-xz" v-if="currentTab == 2">
			<view class='fixed-top-cont-shai'>
				<view class='fixed-top-container-shai' v-if="currentTab == 1">
					<form report-submit='true' @submit='onSubmit'>
						<view class='fixed-top-shai'>
							<view class='fixed-top-left-shai dp-flex-y-center-shai'>
								<button class='fixed-cat-shai fixed-item-shai dp-flex-y-center-shai' form-type='submit' @tap='onTimeType'>
									时间排序
								</button>
								<button class='fixed-birthPlace-shai fixed-item-shai dp-flex-y-center-shai' form-type='submit' @tap='onDistanceType'>
									距离排序
								</button>
								<button class='fixed-birthPlace-shai fixed-item-shai dp-flex-y-center-shai' form-type='submit' @tap='onDistrictType'>
									{{birthPlaceName ? birthPlaceName : "地区筛选"}}
								</button>
								<button class='fixed-cat-shai fixed-item-shai dp-flex-y-center-shai' form-type='submit' @tap='onAllType'>
									全选
								</button>
							</view>

						</view>
					</form>
				</view>
			</view>
			<view class='merchant-list-shop-xz'>
				<view class="shop-list-xz" v-for="(item,index) in second_lists" wx:key="index">

					<view class='card-qz-box'>
						<navigator :url="'../../job-want/job-want?jobId='+item.id" hover-class="none" class='shop-list-xz-mess'>
							<view class='shop-list-xz-head'>
								<image :src="item.poster_img"></image>
							</view>
							<view class='shop-list-xz-cont'>
								<view class='list-cont-name-es'>
									<text class='list-cont-name-name-es'>{{item.title}}</text> <text class='list-cont-name-distance-es'>{{item.distance}}KM</text>
								</view>
								<view>
								</view>
								<view class='list-cont-money-es'>
									<text>¥ </text>
									<text>{{item.money}}</text>
								</view>
								<view class='list-cont-label-es'>
									<text v-if="item.description">{{item.description}}</text>
								</view>
								<view></view>
								<view class='list-cont-location'>
									<image class="address-card-host" mode="scaleToFill" src="https://gy-files.oss-cn-shenzhen.aliyuncs.com/small_img/weizhi.png"></image>
									<text>{{item.address}}</text>
								</view>
							</view>
						</navigator>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 我要装修 -->
		<view class="weui-tab-zb" v-if="currentTab == 3" >
			<view class='banner-lunbo'>
				<swiper indicator-dots="true" autoplay="true" interval='5000' indicator-active-color="#fff" circular="true" style='height:100%;'>
				  <swiper-item >
					<image class='banner-img' src='http://aliyun.oss.zxgyzj.com/job-want/baomin1.jpg'></image>
				  </swiper-item>
				  <swiper-item >
					<image class='banner-img' src='http://aliyun.oss.zxgyzj.com/job-want/baomin2.jpg'></image>
				  </swiper-item>
				  <swiper-item >
					<image class='banner-img' src='http://aliyun.oss.zxgyzj.com/job-want/baomin3.jpg'></image>
				  </swiper-item>
				</swiper>
			</view>
			<!-- ../../user-center/news-detail/news-detail?id=8 -->
			<navigator url="" hover-class="none" class='banner'>
			  <image src='http://aliyun.oss.zxgyzj.com/job-want/used_one.jpg'></image>
			</navigator>
			
			<view class="weui-tab__content" >
			              <form @submit="handleRenoSubmit" report-submit='true'>
			                <view class='weui-cells'>
			<!-- 城市名称 -->
			                  <view class="weui-cell">
			                    <view class="weui-cell__hd">
			                      城市名称
			                    </view>
			                    <view class="weui-cell__bd">
			                      <input type='text' placeholder='请输入城市名称' :value="fixture_city" @blur="bindcity" name="fixture_city" style='width:100%;text-align: right;'></input>
			                    </view>
			                  </view>
			                  <!-- 小区名称 -->
			                  <view class="weui-cell">
			                    <view class="weui-cell__hd">
			                   
			                      小区名称
			                    </view>
			                    <view class="weui-cell__bd">
			                      <input type='text' placeholder='请输入小区名称' :value="fixture_quartes" @blur="bindquartes" name="fixture_quartes"  style='width:100%;text-align: right;'></input>
			                    </view>
			                  </view>
			                  <!-- 购房面积 -->
			                  <view class="weui-cell">
			                    <view class="weui-cell__hd">
			                      <!-- <image class='weui-cell__hd__img' src='http://aliyun.oss.zxgyzj.com/picture/order-title.png'></image> -->
			                      购房面积
			                    </view>
			                    <view class="weui-cell__bd">
			                      <input type='text' placeholder='请输入购房面积' :value="fixture_area" @blur="bindarea" name="fixture_area"  style='width:100%;text-align: right;'></input>
			                    </view>
			                  </view>
			
			                  <view class="weui-cell">
			                    <view class="weui-cell__hd">
			                      <!-- <image class='weui-cell__hd__img' src='http://aliyun.oss.zxgyzj.com/picture/order-title.png'></image> -->
			                      联系电话
			                    </view>
			                    <view class="weui-cell__bd">
			                      <input type='text' placeholder='请输入联系电话' :value="fixture_tel" @blur="bindtel" name="fixture_tel" maxlength='20' style='width:100%;text-align: right;'></input>
			                    </view>
			                  </view>
			
			                 
			                </view>
			
			               
			
			              
			                  <!-- 发布按钮 -->
			                  <view class='btn-area'>
			                      <button id='1' class='submit-btn' hover-class formType="submit">发布</button>
			                  </view>
			              </form>
			             <view class='tips'>
			                <view>特别提醒：</view>
			                <!-- <view>1.为确保订单真实可信，发单需支付诚信金，开工日期后第二天自动退回到发单人余额内。</view> -->
			                <view>1.信息发布后，同城装修项目经理会和您取得联系。</view>
			                <view>2.各项工作落实、满意后，签订装修合同。</view>
			              </view>
			          </view>
					  
				


		</view>
		
		
		
		<!-- 预算材料 -->
		<view v-if="currentTab==0">
			<view class="input-container">
			  <view class="input-content flex">
				<image :src="IMG_URL + 'search-icon1.png'" class='search-image'></image>
				<input class="input-text input-pl" placeholder="请输入搜索关键词" placeholder-class="input-pl" confirm-type='search' type="text" @confirm='inputConfirm'></input>
			  </view>
			</view>
			<scroll-view class="class-scroll" scroll-y>
			  <view class="class-list" :class="item.id==catId?'selected-nav':''" data-num="1" @tap="handleClickChangeClassList" v-for="(item,index) in cat_list" v-for-item="item" :data-id="item.id" :data-index="index">
				<text>{{item.name}}</text>
			  </view>
			  
			</scroll-view>
		
			<scroll-view class="main-scroll" scroll-y @scrolltolower='handleGetMoreListInfo'>
			  <view class="main-scroll-content">
				<image :src='current_img.advert_pic' class='banner-image' @tap="handleClickToAdUrlPage" :data-url="current_img.advert_url" v-if="current_img.advert_pic"></image>

				<view class="goods-container flex-between" v-if="goodsList.length>0">
				  <navigator :url="'/pages/goods_detail/goods_detail?id='+item.id"  v-for='(item,index) in goodsList' v-for-item="item" wx:key='index' class="goods-list">
					  <image :src="item.cover_pic||item.pic_url" class="goods-image"></image>


					  <view class="goods-detail col-between">
						<view class="goods-title text-sl">{{item.name}}</view>
						<view class="goods-price flex-between">
						  <view class="price-text">￥
							<text>{{item.price}}元/{{item.unit}}</text>

						  </view>
						  <image src='http://try11.jiaodaoren.com/zhusiyao/qiaomeijiaren/add-cart.png' class="add-cart"></image>
						</view>
					  </view>


				  </navigator>
				</view>

				  <no-data v-if="goodsList.length<=0"></no-data>

			  </view>
			</scroll-view>
		</view>
		
		
		



	</view>
</template>

<script>
	import app from '@/App.vue';
	import {
		GYZJMODEL as gyzjModel
	} from '@/utils/gyzjModel.js';
	var s = require("@/api.js");
	const util = require("@/utils/util.js");
	export default {
		data() {
			return {
				icoShow: false,
				starLevel: ['', '', '', '', ''],
				//控制bar的移动
				curHdIndex: '0',
				birthPlaceName:'',
				//控制bar
				//追加导航条
				itemList: [
					 { name: '预算', index: 0 },
					 { name: '厂商', index: 1 },
					 { name: '闲置', index: 2 },
					 { name: '装修', index: 3 }
				],
				currentTab: 0,
				list: [{
						id: '1',
						type: '0',
						name: '新南悦陶瓷 (高新建材市场)',
						distance: '10.1',
						main_category: '建材',
						sub_category: '陶瓷',
						address: '望城区高星建材批发大市场3-20栋125号',
						tel: '15200875223',
						shop_avatar: ['https://gy-files.oss-cn-shenzhen.aliyuncs.com/images/xinnan_logo.jpg'],
						starLevel: ['', '', '', '', ''],
						latitude: '28.2956100000',
						longitude: '112.8342510000',
					},
					{
						id: '3',
						type: '0',
						name: '鑫波门面',
						distance: '4.5',
						main_category: '实木',
						sub_category: '地板',
						address: '长沙市望城雷锋机电市场二期1号门面',
						tel: '15802565898',
						shop_avatar: ['https://gy-files.oss-cn-shenzhen.aliyuncs.com/images/xinbo_logo.jpg'],
						starLevel: ['', '', '', '', ''],
						latitude: '28.1994200000',
						longitude: '112.8406000000',
					},
					{
						id: '4',
						type: '0',
						name: '美源环腻子',
						distance: '3.0',
						main_category: '环保',
						address: '长沙市芙蓉区马王推市场3栋302',
						tel: '15399910657',
						shop_avatar: ['https://gy-files.oss-cn-shenzhen.aliyuncs.com/images/meiyuan_logo.jpg'],
						starLevel: ['', '', '', '', ''],
						latitude: '28.1988580000',
						longitude: '113.0260130000',
					},
					{
						id: '5',
						type: '0',
						name: '圣德保陶瓷',
						distance: '1.0',
						main_category: '陶瓷',
						address: '长沙市雨花区万家丽路喜盈门范城三楼圣德保陶瓷',
						tel: '13974999499',
						shop_avatar: ['https://gy-files.oss-cn-shenzhen.aliyuncs.com/images/shengde_logo.jpg'],
						starLevel: ['', '', '', '', ''],
						latitude: '28.1344420000',
						longitude: '113.0344650000',
					}
				],
				second_lists: [{
					// id: '1',
					// type: '0',
					// name: '新南悦陶瓷 (高新建材市场)', distance: '10.1',
					// title:'好的好的好的',
					// address: '望城区高星建材批发大市场3-20栋125号',
					// description:'我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容',
					// tel: '15200875223', poster_img: ['https://gy-files.oss-cn-shenzhen.aliyuncs.com/images/xinnan_logo.jpg'],
					// starLevel: ['', '', '', '', ''],
					// latitude: '28.2956100000',
					// longitude: '112.8342510000',
				}],
				 /**后端新增参数 */
				IMG_URL:'http://try11.jiaodaoren.com/zhusiyao/zhenyangyou/',
				navIndex: 1, //底部导航栏数字    
				navNum: 'default', //导航栏数字
				pailie: 'down', //商品排列顺序up为从小到大，down为从大到小
				cat_id: "",
				page: 1,
				cat_list: [],
				goods_list: [],
				sort: 0,
				sort_type: -1,
				hot_page: 1,
				limit: 5,
				type: 2,
				row_count: '',
				goodsList: [],
				CustomBar:0,
				goods_row_count:[],  //商品总页数
				/**新增一个栏目参数 */
				catId: '',
				catIndex: 0,
				current_img: [],
				current_cat: [],
				   //新增的业主报名
				fixture_city: '',
				fixture_quartes: '',
				fixture_area: '',
				fixture_tel: '',
			}
		},
		methods: {
			bindcity: function (e) {
			    this.fixture_city= e.detail.value;
			  },
			  bindquartes: function (e) {
			    this.fixture_quartes= e.detail.value;
			  },
			  bindarea: function (e) {
			    this.fixture_area= e.detail.value;
			  },
			  bindtel: function (e) {
			    this.fixture_tel= e.detail.value;
			  },
			/**发布信息 */
			  handleRenoSubmit: function (e) {
			
			    //省略表单模板
			    // 未入驻则先去填写入驻信息
			    // if (app.globalData.userInfo.type == 1) {
			    //   util.notVerifyModal('../vip-info/vip-info');
			    //   return;
			    // }
			    let thisData = this;
			    let postData = e.detail.value;
			    postData['city'] = thisData.fixture_city;
			    postData['quartes'] = thisData.fixture_quartes;
			    postData['area'] = thisData.fixture_area;
			    postData['tel'] = thisData.fixture_tel;
			    console.log(thisData);
			    //检测信息是否填写完整
				console.log(postData);
			    let flag = util.isObjValid(postData);
			    if (!flag) {
			      console.log('很抱歉，没有填写完整');
			      return util.showMsg();
			    };
			    let token = app.globalData.token;
			    let userInfo = app.globalData.userInfo;
				var arr = this.main_getGlobal(); 
			    uni.showModal({
			      title: '确认发布',
			      // content: '发布成功将冻结诚信金' + needPay + '元，诚信金可退',
			      content: '是否确定发布该信息？',
			      confirmColor: '#F94C48',
			      success: (res) => {
			        console.log('成功的res是多少');
			        console.log(res);
			        if (res.confirm) {
			          // 发布事件
						 gyzjModel.prototype.orderRenoJob(postData,arr.token,arr.type).then(res=>{
							uni.pageScrollTo({
							  scrollTop: 0
							});
							//发布成功的窗口弹出
							uni.showModal({
							  title: '发布成功',
							  // content: '请勿在内容中填写长串数字！',
							  showCancel: false,
							})
						 });
						 
						 
			//           this.orderRenoJob(token, postData).then((res) => {
			
			//             console.log('小于0的执行');
			//             console.log(res);
			//             uni.pageScrollTo({
			//               scrollTop: 0
			//             });
			//             //发布成功的窗口弹出
			//             uni.showModal({
			//               title: '发布成功',
			//               // content: '请勿在内容中填写长串数字！',
			//               showCancel: false,
			//             })
			        
			//           });
			        }
			      }
			    })
			  },
			inputConfirm(e){
			    var ea = this, sa = e.detail.value;
			    ea.page=1;
			    this.handle_shuai_cate(0, ea.catId,'',sa);
			  },
			handleClickChangeClassList(e) {
			    this.navNum= e.currentTarget.dataset.num;
			    this.page=1;
			    let id = e.currentTarget.dataset.id;
			    let index = e.currentTarget.dataset.index;
			    this.catId=id;
			     this.catIndex= index;
			    this.handle_shuai_cate(0,id);
			  },
			//跳转到广告图链接页面
			  handleClickToAdUrlPage(e) {
			    let url = e.currentTarget.dataset.url;
			    var status=1;
			    var navbarPages=a.page.navbarPages;
			    for (var n in navbarPages){
			      if ('/'+navbarPages[n] == url){
			        status=2;
			      }
			    }
			    if(status==2){
			      uni.switchTab({
			        url,
			      })
			    }else{
			      uni.navigateTo({
			        url,
			      })
			    }
			    console.log('navbarPages', navbarPages);
			  },
			//滚动触底，获取更多列表数据
			  handleGetMoreListInfo() {
			    /**商品列表展示 */
			    // let self = this;
			    // if (self.data.goodsList.length >= self.data.goods_row_count) {
			    //   return;
			    // }
			    // this.data.hot_page++;
			    // this.handle_shuai(this.data.cat_id,this.data.sort,this.data.sort_type,self.data.hot_page);
			    /**商品列表展示结束 */
			    let self = this;
			    if (self.goodsList.length >= self.goods_row_count) {
			      return;
			    }
			    this.page++;
			    this.handle_shuai_cate(0, 0, self.page);
			  },
			/**分类单栏目开始  cat_id为0表示为第一个栏目*/
			  handle_shuai_cate(cat_type=0,cat_id=0,hot_page='',search=''){
			    var e = this;
				var that=this;
			    uni.showNavigationBarLoading(), uni.request({
			      url: s.default.cat_list_one,
			      data:{
			        cat_id,
			        search,
			        limit: e.limit,
			        page: e.page
			      },
			      method: 'GET',
			      success: function (s) {
			        uni.hideNavigationBarLoading();
					s=s.data;
					console.log('进来s的值',s);
					console.log('进来e的值',e);
			        if(0==s.code){
			          if(cat_type==0){
			            /**首页初始加载 */
			            e.cat_list= s.data.list;
			             e.catId= s.data.list[e.catIndex].id;
			          }
			          if (e.page == 1) {
			            e.goodsList= s.data.goods;
			          } else {
			            e.goodsList= e.goodsList.concat(s.data.goods);
			          }
			          e.current_cat= s.data.list[e.catIndex].list;
			           e.current_img= s.data.list[e.catIndex];
			            e.goods_row_count= s.data.goods_row_count;
			        }
			      }
			    });
			  },
			//标签切换
			tab: function(e) {
				let id = e.currentTarget.dataset.id,
					type = 0;
				let arr = this.main_getGlobal();
				console.log(e);
				console.log('首页id' + id);
				this.currentTab = id;
				if (id == 1) {
					this.getJobWantList(2, arr.token, 0, 0, arr.type);
				}
			},
			// 获取二手闲置
			getJobWantList: function(type, token, time, district, loginType) {
				gyzjModel.prototype.getJobWantList(type, token, time, district, loginType).then(data => {
					console.log('二手闲置的值', data);
					switch (data.code) {
						case 1:
							let second_lists = this.second_lists;
							console.log('second_lists的值', second_lists);
							// 处理订单数据
							this.processData(data).then((res) => {
								console.log('res的值');
								console.log(res);
								console.log('lists的值');
								second_lists = res;
								console.log(second_lists);
								this.pageCount = data.data.page_count;
								if (second_lists.length != 0) {
									for (var i = 0; i < second_lists.length; i++) {
										second_lists[i].distance = second_lists[i].distance.slice(0, 3);
									}
								};
								this.second_lists = second_lists;
							});
							break;
						default:
							uni.showToast({
								title: data.message,
								icon: 'none'
							});
							break;
					}
				});
			},
			//时间排序
			onTimeType: function() {
				console.log('时间排序');
				let arr = this.main_getGlobal();
				if (this.native_district_id) {
					console.log('既时间又地区');
					this.getJobWantList(2, arr.token, 1, this.data.native_district_id, arr.type);
				} else {
					console.log('只有时间的排序');
					this.getJobWantList(2, arr.token, 1, 0, arr.type);
				}
			},
			//距离筛选
			onDistanceType: function () {
			    console.log('距离排序');
			    let arr = this.main_getGlobal();
			    this.getJobWantList(2,arr.token, 0, 0,arr.type);
			  },
			//全选排序
			onAllType: function() {
				console.log('时间排序');
				let arr = this.main_getGlobal();
				this.getJobWantList(2, arr.token, 0, 0, arr.type);
				this.birthPlaceName = '地区筛选';
				this.native_district_id = '';
			},
			//地区排序
			onDistrictType: function() {
				console.log('点击距离的筛选');
				let arr = this.main_getGlobal();
				uni.navigateTo({
					url: '../../city-choose/city-choose?pageType=JobListBirthTwo',
				})
				console.log('点击筛选时间');
			},
			// 筛选
			JobDistrictFilter: function() {
				let native_district_id = this.native_district_id;
				let arr = this.main_getGlobal();
				//这里type必须为1才会执行
				this.getJobWantList(2, arr.token, 0, native_district_id, arr.type);
				console.log(native_district_id);
			},
			/*其他的处理数据*/
			processData: function(data) {
				return new Promise((resolve, reject) => {
					let array = [];
					data.data.data.map((cur, index, arr) => {
						// 处理籍贯字段
						cur['birthPlace'] = '';
						if (cur['province']) cur['birthPlace'] += cur['province']['name'];
						if (cur['city']) cur['birthPlace'] += cur['city']['name'];
						if (cur['district']) cur['birthPlace'] += cur['district']['name'];
						array.push(cur);
					})
					resolve(array);
				})
			},
	
			merchantList: function(arr) {
				gyzjModel.prototype.getMerchantsList(arr['token'], arr['type']).then((res) => {
					if (res.code == 1) {
						console.log('店铺介绍');
						console.log(res);
						var lists = res.data.data;
						if (lists.length != 0) {
							for (var i = 0; i < lists.length; i++) {
								console.log('最初的位置');
								console.log(lists[i].distance);
								lists[i].distance = lists[i].distance.slice(0, 5);
								console.log('截取后的位置');
								console.log(lists[i].distance);
								console.log('开始的等级');
								console.log(lists[i].score_level);
								var starLevel = gyzjModel.prototype.convertToStarsArray(lists[i].score_level, 5);
								console.log('截取后的等级');
								console.log(starLevel);
								lists[i].starLevel = starLevel;
								this.list.push(lists[i]);
							}
						}
						console.log('结束的lists');

					}
				})
			},
			//拨打电话
			phonecallevent: function(e) {
				let mobile=e.currentTarget.dataset.tel;
				if(mobile){
					uni.makePhoneCall({
						phoneNumber: e.currentTarget.dataset.tel
					});
				}else{
					uni.showToast({
						title: '暂无电话',
						icon: "none",
					})
				}
				
			},
			//地图导航
			goMap: function(e) {
				let data = e.currentTarget.dataset;
				console.log('导航的data的值',data);
				let latitude = Number(data.latitude);
				let longitude = Number(data.longitude);
				uni.getLocation({
					type: 'gcj02',
					success: function(res) {
						uni.openLocation({
							latitude: latitude,
							longitude: longitude,
							name: data.name,
							address: data.address,
						})
					}
				})
			},
		},
		onLoad: function(options) {
			var arr = this.main_getGlobal();
			this.merchantList(arr);
			/**修改为带分类商品列表 */
			this.handle_shuai_cate();
		},

	}
</script>

<style>
	@import url("../../../static/style/app.css");

	page {
		background-color: #fff;
	}

	.banner {
		width: 100%;
		height: 340upx;
		margin-bottom: 20upx;
	}

	.banner image {
		width: 100%;
		height: 100%;
	}

	.search {
		background-color: #ebefed;
		padding: 20upx;
		position: relative;
	}

	.search input {
		height: 60upx;
		background-color: #fff;
		padding-left: 30upx;
		text-align: center;
	}

	.searchcion {
		position: absolute;
		top: 35upx;
		left: 40%;
		transform: translateX(-50%);
	}

	.merchant-list-sort {
		display: flex;
		background-color: #fff;
		border-top: 1px solid #eee;
		border-bottom: 1px solid #eee;
	}

	.sort-list {
		width: 20%;
		height: 70upx;
		line-height: 70upx;
		text-align: center;
		border-right: 1px solid #eee;
		color: #969696;
		font-size: 28upx;
	}

	.merchant-list-shop {
		background-color: #EBEFED;
		padding-bottom: 40upx;
	}

	.shop-list {
		margin: 30upx 20upx 0;
		background-color: #f9f9f9;
		border: 1px solid #efefef;
		border-radius: 5px;
		box-shadow: 0px 5px 10px 2px #999;
	}

	.shop-list:nth-child(1) {
		margin: -1upx 20upx 0;

	}

	.shop-list-mess {
		display: flex;
		padding: 20upx;
		padding-left: 0upx;
		align-items: center;
		background-color: white;

	}

	.shop-list-cont {
		width: 65%;
	}

	.shop-list-head {
		width: 35%;
		height: 200upx;
		text-align: center;
	}

	.shop-list-head image {
		width: 200upx;
		height: 200upx;
	}

	.list-cont-name {
		display: flex;
	}

	.list-cont-name-name {
		width: 350upx;
		overflow: hidden;
		/*超出部分隐藏*/
		white-space: nowrap;
		/*不换行*/
		text-overflow: ellipsis;
		/*超出部分文字以...显示*/
		font-weight: 600;
		font-size: 32upx;
		margin-right: auto;
	}

	.list-cont-name-distance {
		font-size: 28upx;
		color: #a9a9a9;
		margin-left: 20upx;
	}

	.list-cont-label {
		display: flex;
		margin: 5upx 0;
	}

	.list-cont-label text {
		/* background-color: #eee; */
		/* padding-right: 10upx; */
		color: #ccc;
		font-size: 24upx;
		margin-right: 10upx;

	}

	.list-cont-label text:nth-child(2) {
		padding-left: 10upx;
		border-left: 1px solid #ccc;
	}

	.list-cont-location {
		display: flex;
		align-items: center;
		margin: 10upx 0;
		color: #666;
		font-size: 24upx;
	}

	.list-cont-location image {
		width: 27upx;
		height: 36upx;
		margin-right: 10upx;
	}

	.list-cont-location text {
		margin-top: 10upx;
	}

	.shop-btn {
		display: flex;
		background-color: #ddd;
		border-top: 1px dotted #ccc;
	}

	.shop-btn-list {
		width: 33.3%;
		height: 80upx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 32upx;
		font-weight: 600;
		border-right: 1px dotted #ccc;
	}

	.shop-btn-list:nth-child(3) {
		border-right: none;
	}

	.shop-btn-list image {
		width: 40upx;
		height: 40upx;
		margin-right: 10upx;
	}

	.curHdActive {
		color: #f94c48;
		font-size: 28upx;
	}

	/*新增加的二手闲置导航条*/
	.cont-block {
		display: flex;
		height: 10vh;
		border-bottom: 1px solid #e5e5e5;
	}

	.fixed-top-cont {
		width: 100%;
		background-color: #ebefed;
		display: flex;
		flex-direction: column;
		/* max-height: 20vh;
	  min-height: 12vh; */
		height: 10vh;
		overflow: hidden;
	}

	.cont-list {
		width: 50%;
		/* width: 100%; */
		display: flex;
		align-items: center;
		justify-content: center;
		border-right: 1px solid #e5e5e5;
		font-size: 36upx;
		background-color: #ffffcc;
	}

	.cont-list:nth-child(3) {
		border-right: none;
	}

	.cont-list image {
		width: 20upx;
		height: 15upx;
		margin-left: 10upx
	}

	.cont-list text:nth-child(1) {
		display: block;
		width: 153upx;
		height: 30upx;
		margin-bottom: 10upx;
	}

	/*如果是最后一个样式存在冲突*/
	/* .cont-list:nth-child(4) text:nth-child(1){
	  line-height:100upx;
	} */
	.cont-list .newstabBar {
		text-align: center;
		height: 90upx;
		/* margin-top:-10upx; */
	}

	/* .cont-list:nth-child(1) .newstabBar{
	  border-bottom: 8upx solid white;
	} */
	.cont-list text:nth-child(2) {
		display: block;
		width: 153upx;
		height: 30upx;
	}

	.listActive {
		background-color: #f94c48;
		color: #fff;
	}

	.listActiveWhite {
		border-bottom: 5upx solid white;
	}

	.cont-list .newstabBar {
		text-align: center;
		height: 90upx;
		/* margin-top:-10upx; */
	}

	.list-cont-label-es {
		display: flex;
		margin: 5upx 0;
	}

	.list-cont-label-es text {
		/* background-color: #eee; */
		/* padding-right: 10upx; */
		color: #ccc;
		font-size: 24upx;
		margin-right: 10upx;
		/* height:150upx; */
		/* overflow: hidden;
	  text-overflow: ellipsis; */
		/* white-space: nowrap; */
	}

	.list-cont-label-es text:nth-child(2) {
		padding-left: 10upx;
		border-left: 1px solid #ccc;
	}

	.list-cont-name-es {
		display: flex;
	}

	.list-cont-name-name-es {
		width: 350upx;
		overflow: hidden;
		/*超出部分隐藏*/
		white-space: nowrap;
		/*不换行*/
		text-overflow: ellipsis;
		/*超出部分文字以...显示*/
		font-weight: 600;
		font-size: 32upx;
		margin-right: auto;
	}

	.list-cont-name-distance-es {
		font-size: 28upx;
		color: #a9a9a9;
		margin-left: 20upx;
	}

	.list-cont-money-es {
		font-size: 32upx;
		color: #f94c48;

	}

	.list-cont-money-es text:nth-child(1) {
		font-size: 20upx;
		margin-right: 6upx;
	}

	.list-cont-money-es text:nth-child(2) {
		font-size: 28upx;
	}

	/*闲置背景的修改*/
	.weui-tab-xz {
		position: relative;
		height: 100%;
		/* border-top: 5upx solid white; */
		border-top: 1upx solid white;
		background-color: #EBEFED;
	}

	.shop-list-xz {
		margin: 30upx 20upx 0;
		/* background-color: black; */
		background-color: white;
		border: 1px solid #efefef;
		border-radius: 5px;
		box-shadow: 0px 5px 10px 2px #999;
	}

	.shop-list-xz-mess {
		display: flex;
		padding: 20upx;
		padding-left: 0upx;
		align-items: center;
		margin: 20upx;

	}

	.shop-list-xz-cont {
		width: 65%;
	}

	.shop-list-xz-head {
		width: 35%;
		height: 200upx;
		text-align: center;
	}

	.shop-list-xz-head image {
		width: 200upx;
		height: 200upx;
	}

	.merchant-list-shop-xz {
		background-color: #EBEFED;
		padding-bottom: 40upx;
	}

	/*同城厂商*/
	.tcmerchant {
		height: 30upx;
		background-color: #EBEFED;
		/* border-top:5upx solid white; */
	}

	/*同城二手闲置的筛选开始*/
	.fixed-top-cont-shai {
		width: 100%;
		background-color: white;
		display: flex;
		flex-direction: column;
		max-height: 20vh;
		min-height: 12vh;
		overflow: hidden;
	}

	.fixed-top-container-shai {
		width: 100%;
		background-color: #fff;
		height: 9vh;
		font-size: 14px;
	}

	.fixed-top-shai {
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		height: 100%;
		align-items: center;
		/* border: 1px solid #e5e5e5; */
	}

	.fixed-top-left-shai {
		display: flex;
		margin-left: 20upx;
	}

	.fixed-cat-shai,
	.fixed-birthPlace-shai {
		border: 1px solid #666;
		/* color: #F94C48; */
		border-radius: 5px;
		margin-right: 20upx;
	}

	.fixed-item-shai {
		padding: 0upx 6upx;
		height: 68upx;
		margin-top: 16px;
		line-height: 68upx;
		font-size: 17px;
	}

	/*同城二手闲置的筛选结束*/
	/* 追加卡片效果开始*/
	.card-qz-box {
		width: 94%;
		/* height:100%;
	  background: black; */
		border-radius: 10upx;
		margin: 0 3%;
		background: white
	}
	/*俏美样式开始*/
	.input-container {
	  height: 106upx;
	  display: flex;
	  align-items: center;
	  position: relative;
	}
	
	.input-content {
	  width: 690upx;
	  height: 70upx;
	  background: rgba(247, 247, 249, 1);
	  border-radius: 35upx;
	  margin: 0 auto;
	  padding: 0 40upx;
	  display:flex;
	  align-items:center;
	}
	
	.input-text {
	  flex: 1;
	  padding-left: 18upx;
	}
	
	.input-pl {
	  font-size: 26upx;
	  color: rgba(178, 178, 178, 1);
	}
	
	.search-image {
	  width: 26upx;
	  height: 26upx;
	}
	
	/* 左侧导航栏 */
	
	.class-scroll {
	  position: fixed;
	  left: 0;
	  /* top: 128upx; */
	  top: 234upx;
	  /* bottom: 108upx; */
	   bottom: 28upx;
	  background: #fff;
	  width: 180upx;
	  box-shadow: 0px 6upx 21upx 0px rgba(157, 157, 157, 0.22);
	}
	
	.class-list {
	  text-align: center;
	  height: 100upx;
	  display: flex;
	  align-items: center;
	}
	
	.class-list text {
	  display: inline-block;
	  width: 100%;
	  height: 100upx;
	  line-height: 100upx;
	  font-size: 28upx;
	  color: rgba(85, 85, 85, 1);
	}
	
	.selected-nav {
	  background: rgba(247, 247, 249, 1);
	  position: relative;
	  color: rgba(102, 121, 176, 1);
	}
	
	.selected-nav::before {
	  content: '';
	  width: 8upx;
	  height: 67upx;
	  background: rgba(102, 121, 176, 1);
	  border-radius: 50%;
	  left: -4upx;
	  top: 50%;
	  transform: translateY(-50%);
	  position: absolute;
	}
	
	/* 右侧分类 */
	
	.main-scroll {
	  position: fixed;
	  right: 0;
	  /* top: 128upx; */
	  top: 234upx;
	  /* bottom: 108upx; */
	  bottom: 28upx;
	  width: 570upx;
	}
	
	.main-scroll-content {
	  display: flex;
	  flex-direction: column;
	  /* align-items: flex-end; */
	  padding-left:20upx;
	}
	
	.banner-image {
	  display: block;
	  width: 514upx;
	  height: 160upx;
	  border-radius: 8upx;
	  margin-right: 30upx;
	}
	
	.goods-container {
	  margin-right: 30upx;
	  flex-wrap: wrap;
	  width: 514upx;
	  padding-top: 25upx;
	  display:flex;
	}
	
	.goods-list {
	  width: 250upx;
	  background: rgba(255, 255, 255, 1);
	  border: 1upx solid rgba(242, 242, 242, 1);
	  margin: 0 0 25upx;
	  overflow: hidden
	}
	
	.goods-image {
	  width: 100%;
	  height: 220upx;
	  display: block
	}
	
	.goods-detail {
	  padding: 20upx 10upx 0;
	  height: 220upx;
	}
	
	.goods-title {
	  font-size: 26upx;
	  color: rgba(51, 51, 51, 1);
	  line-height: 34upx;
	  height: 68upx;
	   overflow: hidden;  /*超出隐藏*/
	   text-overflow: ellipsis;  /*超出显示为省略号*/
	   word-break: break-word;
	   white-space:normal !important;
	   display: -webkit-box;
	   -webkit-line-clamp: 3;
	}
	
	.price-text {
	  font-size: 20upx;
	  color: rgba(229, 68, 0, 1);
	}
	
	.price-text text {
	  font-size: 26upx;
	}
	
	.add-cart {
	  width: 24upx;
	  height: 23upx;
	}
	
	.sale-num {
	  border-top: 1upx dotted #c1c1c1;
	  height: 60upx;
	  line-height: 60upx;
	  text-align: right;
	  font-size: 22upx;
	  color: rgba(153, 153, 153, 1);
	}
	/*空的购物车列表*/
	.no-data-tip {
	  padding: 150upx 0;
	  text-align: center;
	  color: #888;
	  margin: 0 auto;
	}
	.no-data-tip .no-data-icon {
	  width: 160upx;
	  height: 160upx;
	  font-size: 0;
	  border-radius: 9999upx;
	  background: rgba(0,0,0,.1);
	  margin-left: auto;
	  margin-right: auto;
	  margin-bottom: 32upx;
	}
	/*俏美样式结束*/
	/*第4备份业主报名*/
	.submit-btn {
	  background-color: #f94c48;
	  color: #fff;
	  letter-spacing: 5px;
	}
	.btn-area {
	  margin: 20rpx 30rpx;
	}
	.weui-cells {
	  position: relative;
	  margin-top: 1.17647059em;
	  background-color: #fff;
	  line-height: 1.41176471;
	  font-size: 17px;
	}
	.weui-cell {
	  padding: 10px 15px;
	  position: relative;
	  display: -webkit-box;
	  display: -webkit-flex;
	  display: flex;
	  -webkit-box-align: center;
	  -webkit-align-items: center;
	  align-items: center;
	}
	.weui-cell__hd {
	  display: flex;
	  width: 38%;
	  align-items: center;
	}
	.weui-cell__bd {
	  color: #666;
	}
	.weui-cell__bd {
	  -webkit-box-flex: 1;
	  -webkit-flex: 1;
	  flex: 1;
	}
	view, cover-view, textarea, input, scroll-view, text, navigator {
	  box-sizing: border-box;
	}
	.tips {
	  margin-top: 40rpx;
	  color: #666;
	  font-size: 16px;
	  padding: 0 30rpx;
	}
	.banner {
	  width: 100%;
	 height: 580rpx;
	 margin-bottom: -20rpx;
	 }
	 .banner image {
	 width: 100%;
	 height: 100%;
	 }
	 .banner-lunbo{
	 width: 100%;
	 height: 350rpx;
	 }
	 .banner-lunbo image {
	 width: 100%;
	 height: 100%;
	 }
</style>
